import { services } from '@/config'

export const tableOption = {
  border: true,
  index: true,
  indexLabel: '序号',
  stripe: true,
  menuAlign: 'center',
  align: 'center',
  searchMenuSpan: 6,
  showView: true,
  dialogWidth: '90%',
  viewBtn: false,
  addTitle: '新增采购订单',
  editBtn: false,
  addBtn: false,
  delBtn: false,
  selection: true,
  tip: false,
  column: [
    {
      type: 'input',
      label: '主键ID',
      prop: 'id',
      span: 12,
      hide: true,
      display: false
    },
    {
      type: 'input',
      label: '唯一编码（用于关联附件）',
      prop: 'unid',
      span: 12,
      hide: true,
      display: false
    },
    {
      type: 'select',
      label: '状态', // ：默认为0{0：草稿、1：处理中、2：已审批、3：已完成、4：作废}
      prop: 'status',
      dicUrl: `${services.adminService}dict/type/purchaseorder_status`,
      dicMethod: 'get',
      props: { label: 'label', value: 'value' },
      span: 8,
      value: '0',
      search: true,
      required: true,
      rules: [
        {
          required: true,
          message: '请选择状态'
        }
      ]
    },
    {
      type: 'input',
      label: '采购单号',
      prop: 'caseid',
      span: 8,
      width: 185,
      search: true,
      disabled: true
    },
    {
      type: 'input',
      label: '采购人',
      prop: 'createBy',
      span: 8,
      search: true,
      disabled: true
    },
    {
      type: 'tree',
      label: '采购单位',
      prop: 'deptId',
      span: 8,
      dicUrl: `${services.adminService}dept/tree`,
      props: { label: 'name', value: 'id' },
      dicMethod: 'get',
      hide: true,
      search: true,
      required: true,
      rules: [
        {
          required: true,
          message: '请选择采购单位'
        }
      ]
    },
    {
      label: '订购时间',
      prop: 'orderDatetime',
      span: 8,
      width: 135,
      type: 'datetime',
      display: true,
      format: 'yyyy-MM-dd HH:mm:ss',
      valueFormat: 'yyyy-MM-dd HH:mm:ss',
      search: true,
      searchSpan: 12,
      searchRange: true
    },
    {
      type: 'datetime',
      label: '采购时间',
      width: 135,
      prop: 'createTime',
      span: 8,
      display: false,
      format: 'yyyy-MM-dd HH:mm:ss',
      valueFormat: 'yyyy-MM-dd HH:mm:ss',
      search: true,
      searchSpan: 12,
      searchRange: true,
      disabled: true
    },
    {
      type: 'input',
      label: '采购人',
      prop: 'createId',
      span: 8,
      display: false,
      hide: true
    },
    {
      type: 'input',
      label: '采购单位',
      prop: 'deptFullname',
      span: 12,
      width: 145,
      display: false
    },
    {
      type: 'select',
      label: '合同或发票',
      prop: 'contractId',
      span: 16,
      props: { label: 'name', value: 'id' },
      dicUrl: `${services.assetService}fyassetcontract/contractTree`,
      dicMethod: 'get',
      searchLabelWidth: 90,
      search: true,
      hide: true
    },
    {
      type: 'input',
      label: '合同或发票名称',
      prop: 'contractName',
      span: 12,
      display: false,
      width: 120
    },
    {
      type: 'input',
      label: '合同或发票编号',
      prop: 'contractNumber',
      span: 12,
      searchLabelWidth: 90,
      display: false,
      hide: true
    },

    {
      type: 'tree',
      label: '供应商',
      prop: 'supplierId',
      span: 8,
      dicUrl: `${services.assetService}fyassetsupplier/tree`,
      dicMethod: 'get',
      props: { label: 'name', value: 'id' },
      dicQuery: { type: 'V' },
      search: true,
      hide: true
    },
    {
      type: 'input',
      label: '供应商',
      prop: 'supplierName',
      span: 12,
      display: false,
      width: 100
    },
    {
      type: 'input',
      label: '申请单号',
      prop: 'parentCaseid',
      span: 12,
      search: true,
      display: false,
      width: 165
    },
    {
      type: 'input',
      label: '收货信息',
      prop: 'receivinfo',
      span: 24,
      search: true,
      width: 120
    },
    {
      type: 'datetime',
      label: '到货时间',
      prop: 'arrivalDatetime',
      width: 135,
      span: 8,
      format: 'yyyy-MM-dd HH:mm:ss',
      valueFormat: 'yyyy-MM-dd HH:mm:ss',
      search: true,
      searchSpan: 12,
      searchRange: true
    },
    {
      type: 'select',
      label: '采购方式', // 01：邀标、02：自采:03：政府采购
      prop: 'method',
      span: 8,
      dicUrl: `${services.adminService}dict/type/purchase_way`,
      dicMethod: 'get',
      props: { label: 'label', value: 'value' }
    },
    {
      type: 'number',
      label: '订单金额',
      prop: 'amount',
      span: 8,
      required: true,
      rules: [
        {
          required: true,
          message: '请填写金额'
        }
      ]
    },

    {
      type: 'select',
      label: '货币类型', // 默认人民币：人民币：、欧元：欧元、美元：美元、法元：法元
      prop: 'currencyType',
      span: 8,
      value: '人民币',
      dicUrl: `${services.adminService}dict/type/asset_currency_unit`,
      dicMethod: 'get',
      props: { label: 'label', value: 'value' }
    },

    {
      type: 'input',
      label: '订单明细',
      prop: 'detailedEx',
      width: 160,
      span: 24,
      display: false
    },
    {
      type: 'textarea',
      label: '订单说明',
      prop: 'explains',
      width: 160,
      span: 24,
      search: true
    },
    {
      type: 'input',
      label: '最后修改人信息',
      prop: 'updateBy',
      span: 12,
      hide: true,
      display: false
    },
    {
      type: 'input',
      label: '最后修改时间',
      prop: 'updateTime',
      span: 12,
      hide: true,
      display: false
    },
    {
      type: 'input',
      label: '单据类型', // ：默认为ALL{ DEVICE:资产类；CONSUMABLES：易耗品；All:混合}
      prop: 'type',
      span: 12,
      hide: true,
      display: false,
      value: 'ALL'
    },
    {
      type: 'input',
      label: '申请单ID',
      prop: 'parentId',
      span: 12,
      hide: true,
      display: false
    },
    {
      type: 'input',
      label: '批次号',
      prop: 'batchnumber',
      span: 12,
      hide: true,
      display: false
    },
    {
      label: '物品列表',
      prop: 'purchaseOrderList',
      type: 'input',
      display: false,
      hide: true,
      span: 24
    },
    {
      label: '',
      prop: 'bottom',
      span: 24,
      size: 'medium',
      formslot: true, // 将自定义表单设置为true
      hide: true
    },
    {
      label: '附件信息',
      prop: 'uploadPage',
      type: 'input',
      formslot: true,
      slot: true,
      span: 24,
      hide: true
    }
  ]
}

export const tablePageOption = {
  border: true,
  index: true,
  indexLabel: '序号',
  stripe: true,
  menuAlign: 'center',
  align: 'center',
  searchMenuSpan: 6,
  showView: true,
  viewBtn: false,
  editBtn: false,
  addBtn: false,
  delBtn: false,
  expand: true,
  rowKey: 'caseid',
  selection: true,
  searchShow: false,
  menu: false,
  column: [
    {
      type: 'input',
      label: '主键ID',
      prop: 'id',
      span: 12,
      hide: true,
      display: false
    },
    {
      type: 'input',
      label: '唯一编码（用于关联附件）',
      prop: 'unid',
      span: 12,
      hide: true,
      display: false
    },
    {
      type: 'select',
      label: '状态', // ：默认为0{0：草稿、1：处理中、2：已审批、3：已完成、4：作废}
      prop: 'status',
      dicUrl: `${services.adminService}dict/type/purchaseorder_status`,
      dicMethod: 'get',
      props: { label: 'label', value: 'value' },
      span: 8,
      value: '0',
      search: true,
      required: true,
      rules: [
        {
          required: true,
          message: '请选择状态'
        }
      ]
    },
    {
      type: 'input',
      label: '单号',
      prop: 'caseid',
      span: 8,
      width: 165,
      search: true,
      disabled: true
    },
    {
      label: '订购时间',
      prop: 'orderDatetime',
      span: 8,
      width: 135,
      type: 'datetime',
      display: true,
      format: 'yyyy-MM-dd HH:mm:ss',
      valueFormat: 'yyyy-MM-dd HH:mm:ss',
      search: true,
      searchRange: true
    },
    {
      type: 'input',
      label: '采购人',
      prop: 'createId',
      span: 8,
      display: false,
      hide: true
    },
    {
      type: 'input',
      label: '采购人',
      prop: 'createBy',
      span: 8,
      search: true,
      disabled: true
    },
    {
      type: 'datetime',
      label: '采购时间',
      width: 135,
      prop: 'createTime',
      span: 8,
      display: false,
      format: 'yyyy-MM-dd HH:mm:ss',
      valueFormat: 'yyyy-MM-dd HH:mm:ss',
      search: true,
      searchRange: true,
      disabled: true
    },
    {
      type: 'tree',
      label: '采购单位',
      prop: 'deptId',
      span: 8,
      dicUrl: `${services.adminService}dept/tree`,
      props: { label: 'name', value: 'id' },
      dicMethod: 'get',
      hide: true,
      search: true,
      required: true,
      rules: [
        {
          required: true,
          message: '请选择采购单位'
        }
      ]
    },
    {
      type: 'input',
      label: '采购单位',
      prop: 'deptFullname',
      span: 12,
      display: false
    },
    {
      type: 'select',
      label: '合同或发票',
      prop: 'contractId',
      span: 16,
      props: { label: 'name', value: 'id' },
      dicUrl: `${services.assetService}fyassetcontract/contractTree`,
      dicMethod: 'get',
      searchLabelWidth: 90,
      search: true,
      hide: true
    },
    {
      type: 'input',
      label: '合同或发票名称',
      prop: 'contractName',
      span: 12,
      display: false,
      width: 120
    },
    {
      type: 'input',
      label: '合同或发票编号',
      prop: 'contractNumber',
      span: 12,
      searchLabelWidth: 90,
      display: false,
      hide: true
    },

    {
      type: 'tree',
      label: '供应商',
      prop: 'supplierId',
      span: 8,
      dicUrl: `${services.assetService}fyassetsupplier/tree`,
      dicMethod: 'get',
      props: { label: 'name', value: 'id' },
      dicQuery: { type: 'V' },
      search: true,
      hide: true
    },
    {
      type: 'input',
      label: '供应商',
      prop: 'supplierName',
      span: 12,
      display: false,
      width: 100
    },
    {
      type: 'datetime',
      label: '到货时间',
      prop: 'arrivalDatetime',
      width: 135,
      span: 8,
      format: 'yyyy-MM-dd HH:mm:ss',
      valueFormat: 'yyyy-MM-dd HH:mm:ss',
      search: true,
      searchRange: true
    },

    {
      type: 'select',
      label: '采购方式', // 01：邀标、02：自采:03：政府采购
      prop: 'method',
      span: 8,
      dicUrl: `${services.adminService}dict/type/purchase_way`,
      dicMethod: 'get',
      props: { label: 'label', value: 'value' }
    },
    {
      type: 'number',
      label: '购置价格',
      prop: 'amount',
      span: 8,
      required: true,
      rules: [
        {
          required: true,
          message: '请填写金额'
        }
      ]
    },
    {
      type: 'select',
      label: '货币类型', // 默认人民币：人民币：、欧元：欧元、美元：美元、法元：法元
      prop: 'currencyType',
      span: 8,
      value: '人民币',
      dicUrl: `${services.adminService}dict/type/asset_currency_unit`,
      dicMethod: 'get',
      props: { label: 'label', value: 'value' }
    },
    {
      type: 'input',
      label: '收货信息',
      prop: 'receivinfo',
      span: 24,
      search: true,
      width: 120
    },
    {
      type: 'input',
      label: '订单明细',
      prop: 'detailedEx',
      width: 160,
      span: 24,
      display: false
    },
    {
      type: 'textarea',
      label: '订单说明',
      prop: 'explains',
      width: 160,
      span: 24
    },
    {
      type: 'input',
      label: '最后修改人信息',
      prop: 'updateBy',
      span: 12,
      hide: true,
      display: false
    },
    {
      type: 'input',
      label: '最后修改时间',
      prop: 'updateTime',
      span: 12,
      hide: true,
      display: false
    },
    {
      type: 'input',
      label: '单据类型', // ：默认为ALL{ DEVICE:资产类；CONSUMABLES：易耗品；All:混合}
      prop: 'type',
      span: 12,
      hide: true,
      display: false,
      value: 'ALL'
    },
    {
      type: 'input',
      label: '申请单ID',
      prop: 'parentId',
      span: 12,
      hide: true,
      display: false
    },
    {
      type: 'input',
      label: '申请单号',
      prop: 'parentCaseid',
      span: 12,
      hide: true,
      display: false
    },
    {
      type: 'input',
      label: '批次号',
      prop: 'batchnumber',
      span: 12,
      hide: true,
      display: false
    },
    {
      label: '物品列表',
      prop: 'purchaseOrderList',
      type: 'input',
      display: false,
      hide: true,
      span: 24
    },
    {
      label: '',
      prop: 'bottom',
      span: 24,
      size: 'medium',
      formslot: true, // 将自定义表单设置为true
      hide: true
    },
    {
      label: '附件信息',
      prop: 'uploadPage',
      type: 'input',
      formslot: true,
      slot: true,
      span: 24,
      hide: true
    }
  ]
}
